from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop009_退货管理搜索"
firefox=openBrowser(urlAdmin) #调用函数打开网址
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'销售管理','退货管理')
# 2.点击退货方式，选择框选择“退款到账户余额”点击“搜索”按钮。
from selenium.webdriver.support.select import Select
s=Select(firefox.find_element_by_name('refund_type'))
s.select_by_visible_text('退款到账户余额')
firefox.find_element_by_xpath('//button[@type="submit"]').click()
#断言
try:
    firefox.find_element_by_xpath('//td[text()="退款到账户余额"]')
    writeLog("%s 测试通过"%testCase)
except:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()
